<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>登录</title>
		<meta name="renderer" content="webkit">
  		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  		<link rel="stylesheet" href="css/layui.css" media="all">
  		<link rel="stylesheet" href="css/login.css" media="all">
       
       <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
  		<style>
  			body{
  				background:url(images/login.png) no-repeat 0 0;
  				background-size: 100% 100%;
  			}
  			.layadmin-user-login-main{
  				opacity: 0.9;
                   background-color:#EBECED;
                    
                    background-color: white;
                    box-shadow: 0 0 6px 5px #DCDCDC;
                     border-radius: 4px;
  			}
  			.layadmin-user-login-header div{
  				font-size:24px;

  			}
  		</style>
	</head>
	<body>
		<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" >

		    <div class="layadmin-user-login-main">
		      <div class="layadmin-user-login-box layadmin-user-login-header">
		        <div>后台管理</div>
		         
		      </div>
		      <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
		        <div class="layui-form-item">
		          <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
		          <input type="text" v-model="username" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="用户名" class="layui-input">
		        </div>
		        <div class="layui-form-item">
		          <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
		          <input type="password" v-model="userpwd" name="password" id="LAY-user-login-password" lay-verify="required" placeholder="密码" class="layui-input">
		        </div>
		         
		        <div class="layui-form-item" style="margin-bottom: 20px;">
		          <!-- <input type="checkbox" name="remember" lay-skin="primary" title="记住密码"> -->
		          <a href="#" class="layadmin-user-jump-change layadmin-link" style="margin-top: 7px;"> </a>
		        </div>
		        <div class="layui-form-item">
		          <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit" @click="login()">登 录</button>
		        </div>
		      
		      </div>
		    </div>
		    
		    <div class="layui-trans layadmin-user-login-footer"> 
		      <p>© 2018 <a   target="_blank">111.com</a></p>
		      <p>
		        <span><a  target="_blank"> </a></span>
		        
		      </p>
		    </div>
		</div>

  <script src="https://unpkg.com/vue/dist/vue.js"></script>
  <script type="text/javascript" src="js/static.js"></script>
  <script type="text/javascript" src="js/global.js"></script>
 
  <script src="layui/layui.all.js"></script>  
  <script>
    
    new Vue({
      el: '#LAY-user-login',
      data: {
        msg:"提示",
         username:"",
          userpwd:"",
        
      },
      mounted(){

      },
      methods:{
        login(){
          let _that=this;






          if(this.username&&this.userpwd){


 var form = new FormData();
form.append("adminName", _that.username);
form.append("password", _that.userpwd);

            $.ajax({
              url: preUrl+'/admin/login',
              type: 'POST',
              "processData": false,
              "contentType": false,
               data:form,

            })
            .done(function(res){
              if(res.code==100){
                  layer.msg("登录成功");
                  window.location.href="index.html";
              }else{
                layer.msg(res.extend.msg);
              }
         })

 

      }
      } 
    }
    })
  </script>

	</body>
</html>
